<template>
  <view :data-theme="cueTheme">
    <basic-components />
    <custom-navbar title="快速选择项" right-icon="icon-xinzeng1" @right-click="pageSkip({}, basicFlag.ADD)" />

    <view class="basic-search-box">
      <template v-if="dataGrid.data.length">
        <view v-for="item of dataGrid.data" :key="item.id" class="table-box">
          <view class="table-row">
            <view class="left">
              <image class="image" :src="setImgUrl(item)" />
              <view class="left-value">
                <view>{{ item.taskName }}</view>
                <view class="type">
                  {{ item.taskType }}
                  <text class="priority">
                    <image v-for="i in item.priority" :key="i" class="image" src="~@/static/img/xing.png" />
                  </text>
                </view>
              </view>
            </view>
            <view class="right">
              <text>{{ item.planTime }} ( 分钟 )</text>
              <text>预计耗时</text>
            </view>
          </view>
          <view class="buttons">
            <view class="edit iconfont icon-bianji" @tap="pageSkip(item, basicFlag.EDIT)" />
            <view class="del iconfont icon-shanchu1" @tap="openDialog(item, basicFlag.REMOVE)" />
          </view>
        </view>
      </template>
      <view v-else-if="dataGrid.loading !== 1" class="main-no-data">
        <image class="add-image" src="~@/static/img/add.png" @tap="pageSkip({}, basicFlag.ADD)" />
      </view>
    </view>

    <m-modal :visible.sync="dialogParams.visible" :content="dialogParams.content" :apis="dialogParams.apis"
      :use-flag="dialogParams.useFlag" :params="dialogParams.params" :select-row-data="dialogParams.selectRowData"
      @submit="search" />
  </view>
</template>

<script>
import { getFiles } from "@/utils/getFiles"
const files = require.context("./mixins", false, /\.js$/)
const mixins = getFiles(files)
import scroll from "@/common/mixins/scroll"

export default {
  mixins: [...mixins, scroll],
  onShow() {
    this.search()
  },
}
</script>

